package testPaper;

/**
 * @author Yancy
 * @program springioctest
 * @create 2020-11-22
 */
public class Demo03 {

  public static void main(String[] args) {
    //

    String s = "自学考试";
    System.out.println(s.substring(2));
    System.out.println(sumOfDivisors(12));
  }

  static int sumOfDivisors(int n) {
    int i;
    int sum = 0;
    for (i = 1; i <= n; i++) {
      if (n % i == 0) {
        System.out.println(i);
        sum = sum + i;
      }
    }
    return sum;
  }
}
